﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QLCHBANGIAY.DATA
{
    public class Category
    {
        #region[Declare variables]
        private string _Id;
        private string _Tag;
        private string _Name;
        private string _Content;
        private string _Level;
        private string _Priority;
        private string _Index;
        private string _Image;
        private string _Title;
        private string _Description;
        private string _Keyword;
        private string _Active;
        private string _Ord;
        private string _Lang;
        private string _Image2;
        #endregion
        #region[Public Properties]
        public string Id { get { return _Id; } set { _Id = value; } }
        public string Tag { get { return _Tag; } set { _Tag = value; } }
        public string Name { get { return _Name; } set { _Name = value; } }
        public string Content { get { return _Content; } set { _Content = value; } }
        public string Level { get { return _Level; } set { _Level = value; } }
        public string Priority { get { return _Priority; } set { _Priority = value; } }
        public string Index { get { return _Index; } set { _Index = value; } }
        public string Image { get { return _Image; } set { _Image = value; } }
        public string Title { get { return _Title; } set { _Title = value; } }
        public string Description { get { return _Description; } set { _Description = value; } }
        public string Keyword { get { return _Keyword; } set { _Keyword = value; } }
        public string Active { get { return _Active; } set { _Active = value; } }
        public string Ord { get { return _Ord; } set { _Ord = value; } }
        public string Lang { get { return _Lang; } set { _Lang = value; } }
        public string Image2 { get { return _Image2; } set { _Image2 = value; } }
        #endregion
        #region[Category IDataReader]
        public Category CategoryIDataReader(IDataReader dr)
        {
            Category obj = new Category();
            obj.Id = (dr["Id"] is DBNull) ? string.Empty : dr["Id"].ToString();
            obj.Tag = (dr["Tag"] is DBNull) ? string.Empty : dr["Tag"].ToString();
            obj.Name = (dr["Name"] is DBNull) ? string.Empty : dr["Name"].ToString();
            obj.Content = (dr["Content"] is DBNull) ? string.Empty : dr["Content"].ToString();
            obj.Level = (dr["Level"] is DBNull) ? string.Empty : dr["Level"].ToString();
            obj.Priority = (dr["Priority"] is DBNull) ? string.Empty : dr["Priority"].ToString();
            obj.Index = (dr["Index"] is DBNull) ? string.Empty : dr["Index"].ToString();
            obj.Image = (dr["Image"] is DBNull) ? string.Empty : dr["Image"].ToString();
            obj.Title = (dr["Title"] is DBNull) ? string.Empty : dr["Title"].ToString();
            obj.Description = (dr["Description"] is DBNull) ? string.Empty : dr["Description"].ToString();
            obj.Keyword = (dr["Keyword"] is DBNull) ? string.Empty : dr["Keyword"].ToString();
            obj.Active = (dr["Active"] is DBNull) ? string.Empty : dr["Active"].ToString();
            obj.Ord = (dr["Ord"] is DBNull) ? string.Empty : dr["Ord"].ToString();
            obj.Lang = (dr["Lang"] is DBNull) ? string.Empty : dr["Lang"].ToString();
            obj.Image2 = (dr["Image2"] is DBNull) ? string.Empty : dr["Image2"].ToString();
            return obj;
        }
        #endregion
    }
}
